package com.shigu.postFee.enums;

public enum PostFeeType {
    NUM(1,"计件"),
    WEIGHT(2,"计重"),
    FREE(3,"包邮");

    PostFeeType(int value, String title) {
        this.value = value;
        this.title = title;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    private int value;
    private String title;


    /**
     * 按值取枚举对象
     * @param value
     * @return
     */
    public static PostFeeType selByValue(int value){
        for(PostFeeType s:PostFeeType.values()){
            if (s.getValue()==value) {
                return s;
            }
        }
        return null;
    }
}
